﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;
using System.Windows.Forms;


namespace Encircle_XML_Parser
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            // Get the Key for the file to Encrypt.
            var sSecretKey = Cypto.GenerateKey();

            // Encrypt the file.        
           Encircle_XML_Parser.Cypto.EncryptFile(@"E:\MyData.txt",
               @"E:\Encrypted.txt",
               sSecretKey);

            // Decrypt the file.
           Encircle_XML_Parser.Cypto.DecryptFile(@"E:\Encrypted.txt",
               @"E:\Decrypted.txt",
               sSecretKey);
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            PageContainer.NavigationService.Navigate(new Pages.HomePage());
        }

        private void mnuAbout_Click(object sender, RoutedEventArgs e)
        {
            PageContainer.NavigationService.Navigate(new Pages.AboutUs());
        }

        private void mnuExit_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Application.Current.Shutdown();
        }

        private void btnMinimize_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }

        private void mnuLoadXps_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.MessageBox.Show("Load");
        }

        private void mnuClose_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.MessageBox.Show("Close");
            PageContainer.NavigationService.Navigate(new Pages.HomePage());
        }

        private void btnClose_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            System.Windows.Application.Current.Shutdown();
        }

        private void mnuAddTemp_Click(object sender, RoutedEventArgs e)
        {
            PageContainer.NavigationService.Navigate(new Pages.Templates());
        }
    }
}
